package com.tuni.birthdaymoney.persistence.entity;

// Generated 28.04.2013 16:40:29 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * BmPosition generated by hbm2java
 */
@Entity
@Table(name = "BM_Position")
public class Position implements java.io.Serializable {

    private Integer id;
    private String name;
    private Set<Person> persons = new HashSet<Person>(0);

    public Position() {
    }

    public Position(String name) {
        this.name = name;
    }

    public Position(String name, Set<Person> persons) {
        this.name = name;
        this.persons = persons;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "ID", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "Name", nullable = false, length = 25)
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "position")
    public Set<Person> getPersons() {
        return this.persons;
    }

    public void setPersons(Set<Person> persons) {
        this.persons = persons;
    }

}
